]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[clockPreferences] Fix translations
authorFlorian Müllner <fmuellner@src.gnome.org>
Mon, 17 May 2010 12:03:47 +0000 (14:03 +0200)
committerFlorian Müllner <fmuellner@src.gnome.org>
Tue, 25 May 2010 21:03:15 +0000 (23:03 +0200)
The preference dialog for the panel clock does not set its gettext
domain, so it's not translated even if though translations are
already available.
Fix by setting the domain in the GtkBuilder file and binding the
domain to the locale directory.

https://bugzilla.gnome.org/show_bug.cgi?id=618873

data/clock-preferences.ui
js/prefs/clockPreferences.js
src/Makefile.am
src/gnome-shell-clock-preferences.in

index cc04f725e632e27c823dfe2c28a9a468df2af2bb..2e22d9aa95409545895b2dbcab39e74b0f137068 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<interface>
+<interface domain="gnome-shell">
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy project-wide -->
   <object class="GtkDialog" id="prefs-dialog">
index 757eb7cf1f3fd9afedec116a2293c80be2d29465..180358bad3ea6fbe2d3835fb18adc9dc51e3465a 100644 (file)
@@ -7,6 +7,8 @@ const GConf = imports.gi.GConf;
 const Lang = imports.lang;
 const Signals = imports.signals;
 
+const Gettext = imports.gettext;
+
 const GCONF_DIR        = '/desktop/gnome/shell/clock';
 const FORMAT_KEY       = GCONF_DIR + '/format';
 const SHOW_DATE_KEY    = GCONF_DIR + '/show_date';
@@ -80,6 +82,9 @@ Signals.addSignalMethods(ClockPreferences.prototype);
 function main(params) {
     if ('progName' in params)
         GLib.set_prgname(params['progName']);
+    if ('localeDir' in params)
+        Gettext.bindtextdomain('gnome-shell', params['localeDir']);
+
     Gtk.init(null, null);
 
     let clockPrefs = new ClockPreferences(params['uiFile']);
index 6200dc55916dd5490f4b4229a22c82b7aabe3b54..5ab98c351180d8b9d1a19452951f9e1a46e50aa6 100644 (file)
@@ -26,6 +26,7 @@ EXTRA_DIST += gnome-shell.in
 
 gnome-shell-clock-preferences: gnome-shell-clock-preferences.in
        $(AM_V_GEN) sed -e "s|@pkgdatadir[@]|$(pkgdatadir)|" \
+           -e "s|@localedir[@]|$(datadir)/locale|" \
            -e "s|@GJS_CONSOLE[@]|$(GJS_CONSOLE)|" \
            $< > $@ && chmod a+x $@
 CLEANFILES += gnome-shell-clock-preferences
index 419d0085d4194e8f2c698e446cdd512f70da0865..9c471ab91f6342d36c75aa35e3340e546d7a22a9 100644 (file)
@@ -11,8 +11,11 @@ else
 fi
 
 progName="`basename $0`"
+localeDir="@localedir@"
 uiFile="$uiDir/clock-preferences.ui"
 export GJS_PATH="$jsDir"
 
 @GJS_CONSOLE@ -c "const ClockPreferences = imports.prefs.clockPreferences;
-ClockPreferences.main({ progName: '$progName', uiFile: '$uiFile' });"
+ClockPreferences.main({ progName: '$progName',
+                        uiFile: '$uiFile',
+                        localeDir: '$localeDir' });"